/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kmcsoft.goldshop.model.exchange;

import com.kmcsoft.emaster.entity.TrackableEntity;
import com.kmcsoft.goldshop.model.master.Currency;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.FetchGroup;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

/**
 *
 * @author kmcsoft02
 */
@PersistenceCapable(detachable = "true", table = "EXC_CurrencyExchangeDetail")
@FetchGroup(name = "detach_CurrencyExchangeDetail_Currency", members = {
        @Persistent(name = "currency")})
public class CurrencyExchangeDetail extends TrackableEntity {

    @Persistent
    @Column(defaultValue = "0")
    private double sellingPrice;
    @Persistent
    @Column(defaultValue = "0")
    private double buyingPrice;
    @Persistent
    private Currency currency;

    public CurrencyExchangeDetail(Currency currency) {
        this.sellingPrice = currency.getSellingPrice();
        this.buyingPrice = currency.getBuyingPrice();
        this.currency=currency;
    }

    public double getBuyingPrice() {
        return buyingPrice;
    }

    public void setBuyingPrice(double buyingPrice) {
        this.buyingPrice = buyingPrice;
    }

    public double getSellingPrice() {
        return sellingPrice;
    }

    public void setSellingPrice(double sellingPrice) {
        this.sellingPrice = sellingPrice;
    }

    public Currency getCurrency() {
        return currency;
    }

    public void setCurrency(Currency currency) {
        this.currency = currency;
    }
    
}
